package com.joey.jvm.example.lambda;

import lombok.extern.slf4j.Slf4j;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * @Author hyy
 **/
@Slf4j
public class Main extends JFrame{

    private JButton jButton;

    public Main(){
        this.setBounds(200,200,400,200);
        this.setTitle("Game");

        jButton = new JButton("click");
        jButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                log.info("clicked");
            }
        });
        jButton.addActionListener(e -> {
            log.info("clicked2");
        });
        this.add(jButton);
        this.setVisible(true);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
        new Main();
    }
}
